import { http } from '@/utils/http';
import type { OrderType } from '@/types/order';

export const insertOrderAPI = (order: OrderType) => {
  return http<boolean>({
    url: '/orders',
    method: 'POST',
    data: order,
  });
};

export const queryAllOrder = (orderType?: string) => {
  return http<Array<OrderType>>({
    url: `/orders?ot=${orderType ? orderType : ''}`,
    method: 'GET',
  });
};
